package com.tanhua.server.service;

import com.tanhua.commons.utils.UserHolder;
import com.tanhua.dubbo.api.QuestionApi;
import com.tanhua.model.domain.db.Question;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

/**
 * @author maorf
 * @version 1.0
 */

@Service
public class QuestionService {
    @DubboReference
    private QuestionApi questionApi;
    public void setQuestions(String questions) {
        Long userId = UserHolder.getUserId();
        Question question = new Question();
        question.setTxt(questions);
        question.setUserId(userId);
        questionApi.save(question);
    }
}
